package com.foreknow.demo10;

public class A {
    //如果定义了一个有参的构造器，默认的无参构造器就会自动失效
    private String msg;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public A(){

    }
    public A(String name){
        System.out.println(name);
    }
    public void message(){
        System.out.println(getMsg());
    }
}
